﻿using BaseUI;
using BLL;
using Model;
using System;

namespace Thksoft.BusinessExpansion.Templete
{
    public partial class Add_BasisSettings : BasePage
    {
        private Qs_Base_SetBLL qbb = new Qs_Base_SetBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            Qs_Base_Set model = new Qs_Base_Set();
            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show(Page, "请输入名称");
                return;
            }
            if (string.IsNullOrEmpty(txtValue.Text))
            {
                MessageBox.Show(Page, "请输入值");
                return;
            }
            model.Set_name = txtName.Text;
            model.Set_value = txtValue.Text;
            model.REMARK = txtRemark.Text;
            int count = qbb.InsertModel(model, "");
            if (count > 0)
            {
                MessageBox.Show(Page, "保存成功");
                return;
            }
            else
            {
                MessageBox.Show(Page, "保存失败");
                return;
            }
        }

        protected void btnReturn_Click(object sender, EventArgs e)
        {
            Response.Redirect("BasisSettings.aspx");
        }
    }
}